{if $field == "name"}
	<div class="key">姓名</div>
	<div class="val">
		<a class="_first" data-val="{$member.first_name}">{$member.first_name}</a>
		<a class="_last" data-val="{$member.last_name}">{$member.last_name}</a>
	</div>
	<div class="privacy">{0|privacy_format}</div>
{else if $field == "sex"}
	<div class="key">性别</div>
	<div class="val" data-val="{$member.sex|sex_key}">{$member.sex|sex_format}</div>
	<div class="privacy" data-val="{$member.privacy.sex|privacy_key}">{$member.privacy.sex|privacy_format}</div>
{else if $field == "birthday"}
	<div class="key">生日</div>
	<div class="val">
		<a class="_year" data-val="{$member.info.birthday|date_format:"%Y"}">{$member.info.birthday|date_format:"%Y"}</a>年
		<a class="_month" data-val="{$member.info.birthday|date_format:"%m"}">{$member.info.birthday|date_format:"%m"}</a>月
		<a class="_day" data-val="{$member.info.birthday|date_format:"%d"}">{$member.info.birthday|date_format:"%d"}</a>日
	</div>
	<div class="privacy" data-val="{$member.privacy.birthday|privacy_key}">{$member.privacy.birthday|privacy_format}</div>
{else if $field == "blood"}
	<div class="key">血型</div>
	<div class="val" data-val="{$member.info.blood|blood_key}">{$member.info.blood|blood_format}</div>
	<div class="privacy" data-val="{$member.privacy.blood|privacy_key}">{$member.privacy.blood|privacy_format}</div>
{else if $field == "sign"}
	<div class="key">个性宣言</div>
	<div class="val" data-val="{$member.info.sign}">{$member.info.sign|htmlspecialchars}</div>
	<div class="privacy">{0|privacy_format}</div>
{else if $field == "mobile"}
	<div class="key">手机</div>
	<div class="val" data-val="{$member.mobile}">{$member.mobile}</div>
	<div class="privacy" data-val="{$member.privacy.mobile|privacy_key}">{$member.privacy.mobile|privacy_format}</div>
{else if $field == "email"}
	<div class="key">邮箱</div>
	<div class="val" data-val="{$member.email}">{$member.email}</div>
	<div class="privacy" data-val="{$member.privacy.email|privacy_key}">{$member.privacy.email|privacy_format}</div>
{else if $field == "portrait"}
	<div class="key">头像</div>
	<div class="val" data-val="{$member.portrait}"><img src="{if $member.portrait}{$member.portrait}{else}/images/portrait.png{/if}" width="100px" /></div>
	<div class="privacy"></div>
{else if $field == "portrait-upload"}
<script type="text/javascript">
var url = "{$member.image.url}";
var max_width = 700, max_height = 450;
var width = {$member.image.width}, height = {$member.image.height};
var jc_top = 0, jc_left = 0, jc_length = 0;
var ib_top = 0, ib_left = 0;

{literal}

// 头像显示大小
if(width > max_width){
	height = height / width * max_width;
	width = max_width;
}
if(height > max_height){
	width = width / height * max_height;
	height = max_height;
}

// 头像居中
ib_top = (max_height - height) / 2;
ib_left = (max_width - width) / 2;

// 选择框处理
if(width > height){
	jc_left = (width - height) / 2;
	jc_length = height;
}else{
	jc_top = (height - width) / 2;
	jc_length = width;
}
jc_size = width / max_width * 250;

// 写入默认参数
$(".dialog-portrait *[name=step]").val("scope");
$(".dialog-portrait *[name=width]").val(width);
$(".dialog-portrait *[name=height]").val(height);
$(".dialog-portrait *[name=url]").val(url);

// 初始化界面&绑定
$(".dialog-portrait .panel").append("<div class='imageboard'><img src='" + url + "' width='100%' height='100%' /></div>");
$(".dialog-portrait .panel .imageboard").css({"position": "relative", "top": ib_top + "px", "left": ib_left + "px", "width": width + "px", "height": height + "px"});
$(".dialog-portrait .panel img").Jcrop({
	aspectRatio: 1,
	allowSelect: false,
	minSize: [jc_size, jc_size],
	setSelect: [jc_left, jc_top, jc_length, jc_length],
	onChange: function(obj){
		$(".dialog-portrait *[name=top]").val(obj.y);
		$(".dialog-portrait *[name=left]").val(obj.x);
		$(".dialog-portrait *[name=length]").val(obj.h);
	},
	onSelect: function(obj){
		$(".dialog-portrait *[name=top]").val(obj.y);
		$(".dialog-portrait *[name=left]").val(obj.x);
		$(".dialog-portrait *[name=length]").val(obj.h);
	}
});

{/literal}
</script>
{/if}
